Skip to content

Coerce MCL exceedance value to float before comparison#106

Merged
jirhiker merged 1 commit into
mainfrom
claude/vigorous-franklin-eb2135
Jun 30, 2026
Merged

Coerce MCL exceedance value to float before comparison#106
jirhiker merged 1 commit into
mainfrom
claude/vigorous-franklin-eb2135

Conversation

@jirhiker

Copy link
Copy Markdown
Member

What

In dump_mcl_exceedance_collection (backend/persisters/ogc_features.py), the exceedance flag compared the raw latest_value directly against the float mcl:

exceeds = value is not None and mcl is not None and value > mcl

latest_value can arrive as a str from some sources, so value > mcl raised:

TypeError: '>' not supported between instances of 'str' and 'float'

which surfaced as a Dagster step failure on the nm_mcl_exceedance op.

Fix

Coerce the value through the existing _num() helper before comparing:

num = _num(value)
exceeds = num is not None and mcl is not None and num > mcl

Unparseable / missing values become None → no exceedance flag, matching prior missing-value behavior.

Notes for reviewer

  • Reuses the existing _num() helper (same module) rather than adding a new one.
  • No change to stored props[analyte] (still the original value); only the comparison is hardened.

latest_value can be a str while mcl is a float, raising
TypeError: '>' not supported between instances of 'str' and 'float'.
Parse the value via _num() first; unparseable values yield no flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

Your pull request is automatically being deployed to Dagster Cloud.

Location Status Link Updated
die-orchestration View in Cloud Jun 30, 2026 at 03:13 AM (UTC)

@jirhiker jirhiker merged commit 8af2f9d into main Jun 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant